package com.mf.service.impl;

import com.mf.entity.OrderGoods;
import com.mf.repository.OrderGoodsRepository;
import com.mf.service.OrderGoodsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 商品订单实现类
 *
 * @author: Jiang Runqing
 * @date: 2018-09-10 22:03
 */
@Service
public class OrderGoodsServiceImpl implements OrderGoodsService {

    @Resource
    private OrderGoodsRepository orderGoodsRepository;


    @Override
    public List<OrderGoods> getListByOrderId(Integer orderId) {
        return orderGoodsRepository.getListByOrderId(orderId);
    }

    @Override
    public OrderGoods save(OrderGoods orderGoods) {
        return orderGoodsRepository.saveAndFlush(orderGoods);
    }
}
